#pragma once

#include "ui_HelloPlayerQt.h"
#include <QtWidgets/QMainWindow>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QString>

class HelloPlayerQt : public QMainWindow {
    Q_OBJECT

  public:
    HelloPlayerQt(QWidget *parent = nullptr);
    ~HelloPlayerQt();

  public slots:
    void on_startButton_clicked();

  private:
    void dragEnterEvent(QDragEnterEvent *event);
    void dropEvent(QDropEvent *event);

    void UpdateState();
    void UpdateTitle();
    void ReadImageFrame(const unsigned char* buffer, int width, int height);
    void DebugMsg(const char *msg);
    void Play(const QString& url);

    enum State {
        BEGIN,
        PLAYING,
        PAUSED,
    } state{State::BEGIN};
    Ui::HelloPlayerQtClass ui;
    QString url;
};
